<?php 
							$carts=0;
                        	$array_cart=array();
                        	if(isset($_SESSION['cart'])){
                        		$array_cart=$_SESSION['cart'];
                        		$carts=count($array_cart);
                        	}
                        	
                        	?>
<style>
<!--


#firstlevel:hover .sub-menu-wrapper {
	color:#F00;
	display: block;
}
#firstlevel .sub-menu-wrapper:hover {
	color:#F00;
	display: block;
}

#sub-menu-wrapper {
    display: none;
    z-index: 200;
    position: absolute;
    width: 180px;
    top: 30px;
    left: 50%;
    margin-left: -100px;
}
.sub-menu:after {
    top: -2px;
    left: 50%;
    margin-left: -1px;
    border-right: 3px solid transparent;
    border-bottom: 3px solid #FFF;
    border-left: 3px solid transparent;
    position: absolute;
    display: inline-block;
}
.sub-menu:before {
    top: -3px;
    left: 50%;
    margin-left: -2px;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #CCC;
    border-left: 4px solid transparent;
    position: absolute;
    display: inline-block;
}
.sub-menu {
    background-color: #FFF;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
    background-clip: padding-box;
    overflow: hidden;
    padding: 5px 0px;
}
-->
</style>
<div class="frame-header">
  <div class="header">
    <div class="header_content"> <a class="logo" href="<?=base_url('home')?>"></a>
      <div class="frame_search"> <span class="icon_letter"></span>
        <form action="<?=base_url('list_deal/search')?>" method="get">
          <input name="name_deal" type="text" />
          <input name="" type="submit" value="Tìm kiếm" />
        </form>
      </div>
      <?php if(isset($_SESSION['accountdeal'])){
      	$mang=$_SESSION['accountdeal'];
      	?>
      
      <div style="right: 0px;width: 200px;height: 59px;top: 30px;position: absolute;" id="sign_io">
      <ul style="list-style-type: none;">
			<li id="firstlevel" style="float: left;height: 56px;line-height: 25px;padding: 2px 0px;">					
<span style="line-height: 25px;">
<a href="<?=base_url('account/person')?>" style="font-size: 13px;background: none repeat scroll 0% 0% transparent;color: #FFF;padding: 20px 15px;text-decoration: none; " class="cart">
<?=$mang[2]?>
</a>
</span>
<div class="sub-menu-wrapper" id="sub-menu-wrapper">
<ul class="sub-menu">
<li style="padding-left: 15px;">
<a href="<?=base_url('account/person')?>" >Thông tin cá nhân</a>
</li>
<?php if($mang[8]==1){?>
<li style="padding-left: 15px;">
<a href="<?=base_url('account/add_deal')?>" >Thêm Deal</a>
</li>
<li style="padding-left: 15px;">
<a href="<?=base_url('account/list_deal_account')?>" >Danh sách Deal</a>
</li>
<?php }?>

<!-- <li style="padding-left: 15px;">
<a href="<?=base_url('account/order')?>" >Đơn hàng</a>
</li> -->
<li style="padding-left: 15px;">
<a href="<?=base_url('account/logout')?>">Đăng xuất</a>
</li>

</ul>
</div>
</li>
</ul>
<!--sign_io--></div>
      <?php }else{?>
      <div class="login"> <a href="<?=base_url('account/login')?>" style="min-width: 70px">Đăng nhập</a> </div>
      <div class="register"><a href="<?=base_url('account/register')?>">Đăng ký</a></div>
      <?php }?>
      <div class="giohang2"><a  title="Giỏ hàng" href="<?=base_url('cart')?>" id="count_cart"><?=$carts?></a></div>
    </div>
  </div>
  <div class="menu">
  
  
    <ul>
    
      <li class="active"><a  href="<?=base_url('dealtoday')?>">Deal hôm nay</a></li>
      <?php foreach ($list_category as $value){
					if($value['id_parent']==0){
				?>
	      <li><a href="<?=base_url('list_deal?cid='.$value['id'])?>"><?=$value['nameVN']?>  <?php if($value['countdeal']>0){ echo '('.$value['countdeal'].')';}?></a>
	      	<?php if($value['countcategory']>0){?>
	      	<ul class="menu_level2">
			<?php foreach ($list_category as $value1){
					if($value1['id_parent']==$value['id']){
					?>
					<li><a href="<?=base_url('list_deal?mcid='.$value['id'].'&cid='.$value1['id'])?>"><?=$value1['nameVN']?></a></li>
					<?php }
					}?>	     
			</ul>					 
			<?php }?>
	      	<!-- 
	          
	          <li><a href="#">sub 2</a></li>
	          <li><a href="#">sub 3</a></li>
	        </ul> -->
	      </li>
	      <?php }
				}
		?>
      
    </ul>
  </div>
</div>